Fix non-double-buffered drawing
authorAlexander Larsson <alexl@redhat.com>
Thu, 9 Feb 2012 20:05:35 +0000 (21:05 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 9 Feb 2012 20:14:07 +0000 (21:14 +0100)
There was a sign issue in a coordinate transform that made us
flush the wrong region when flushing an implicit paint.
The non-double buffered drawing would then be drawn over the
right area, but then at the end of the implicit paint this
would be overdrawn with the area we didn't properly remove
from the implicit paint.

Also, the translation from window coords to impl window
coords is now done before removing any active double
buffered paints, as these are also in impl window coords.

gdk/gdkwindow.c

index 1a64f43cb41c89c7ea136dd4c760dc4cddadfab7..1642424c6727a15fced6a98d2074d41b0d3536a4 100644 (file)
@@ -2765,6 +2765,9 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
   paint->flushed = TRUE;
   region = cairo_region_copy (window->clip_region_with_children);
 
+  cairo_region_translate (region, window->abs_x, window->abs_y);
+  cairo_region_intersect (region, paint->region);
+
   /* Don't flush active double buffers, as that may show partially done
    * rendering */
   for (list = window->paint_stack; list != NULL; list = list->next)
@@ -2774,9 +2777,6 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
       cairo_region_subtract (region, tmp_paint->region);
     }
 
-  cairo_region_translate (region, -window->abs_x, -window->abs_y);
-  cairo_region_intersect (region, paint->region);
-
   if (!GDK_WINDOW_DESTROYED (window) && !cairo_region_is_empty (region))
     {
       cairo_t *cr;